<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MouseEventTest</title>
<script type="text/javascript"  src="../../flash/FlashCore.js"></script>
<!---->
 <script type="text/javascript" src="../../flash/geom/Point.js"></script> 
 <script type="text/javascript" src="../../flash/geom/Rectangle.js"></script> 
 <script type="text/javascript" src="../../flash/geom/Matrix.js"></script> 
<!---->
 <script type="text/javascript" src="../../flash/events/Event.js"></script> 
 <script type="text/javascript" src="../../flash/events/EventDispatcher.js"></script> 
 <script type="text/javascript" src="../../flash/events/KeyboardEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/MouseEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/ProgressEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/TimerEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/IOErrorEvent.js"></script> 
<!---->
 <script type="text/javascript" src="../../flash/net/URLVariables.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLRequest.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLRequestMethod.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLLoaderDataFormat.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLLoader.js"></script> 
 
  <script type="text/javascript" src="../../flash/resource/ResVO.js"></script> 
 <script type="text/javascript" src="../../flash/resource/ResLoadedEvent.js"></script> 
 <script type="text/javascript" src="../../flash/resource/ResProgressEvent.js"></script> 
 <script type="text/javascript" src="../../flash/resource/ResPool.js"></script> 

<script type="text/javascript"  src="../../flash/display/DisplayObject.js"></script>
<script type="text/javascript"  src="../../flash/display/InteractiveObject.js"></script>
<script type="text/javascript"  src="../../flash/display/DisplayObjectContainer.js"></script>
<script type="text/javascript"  src="../../flash/display/Stage.js"></script>
<script type="text/javascript"  src="../../flash/display/BitmapData.js"></script>
<script type="text/javascript"  src="../../flash/display/Bitmap.js"></script>
<script type="text/javascript"  src="../../flash/display/Loader.js"></script>
<script type="text/javascript"  src="../../flash/display/Graphics.js"></script>
<script type="text/javascript"  src="../../flash/display/Shape.js"></script>
<script type="text/javascript"  src="../../flash/display/Sprite.js"></script>
<script type="text/javascript"  src="../../flash/display/MovieClip.js"></script>
<script type="text/javascript"  src="../../flash/display/MovieClip2.js"></script>
<script type="text/javascript" >

window.onload = function(){
	//框架主程序入口
	var core = new FlashCore();
	core.setCanvas( document.getElementById("cav"));
	core.setMouseEnabled(true);
	core.start();
	
	//对stage进行一些参数设置
	var stage = FlashCore.stage;
	//加载图片
	var resManager = ResPool.getInstance() ;
	var container = new Sprite();
	container.setX(130);
	container.setY(30);
	stage.addChild( container );
	var mc ;
	//加载
	var resArray = [ 
	                 new ResVO("res1","../res/Puerco_espin_1.png"), 
	                 new ResVO("res2","../res/Puerco_espin_2.png"), 
	                 new ResVO("res3","../res/Puerco_espin_3.png"), 
	                 new ResVO("res4","../res/Puerco_espin_4.png")
	                 ];
	function resQueueLoadedHandler(event){
		resManager.removeEventListener(ResLoadedEvent.RES_QUEUE_LOADED , resQueueLoadedHandler);
		resArray=[
				resManager.getResVOByName("res1").content,
				resManager.getResVOByName("res2").content,
				resManager.getResVOByName("res3").content,
				resManager.getResVOByName("res4").content
		          ];
		//创建MovieClip2
		mc = new MovieClip2(  8 , resArray );
		mc.setX(100);
		mc.setY(100);
		//mc.centerPivot();
		container.addChild(mc);
		mc.play();
		mc.mouseEnabled=true ;

		function onMouseMove(e)
		{
			document.getElementById("debug").innerHTML += e.getTarget().className+ "  "+e.getType();
		};
		mc.addEventListener(MouseEvent.MOUSE_OVER , onMouseMove );
		mc.addEventListener(MouseEvent.MOUSE_OUT , onMouseMove );
		mc.addEventListener(MouseEvent.CLICK , onMouseMove );
	}
	resManager.addEventListener(ResLoadedEvent.RES_QUEUE_LOADED , resQueueLoadedHandler);
	resManager.queueLoad(resArray);
	
} ;

</script>
</head>
<body>
<div id="debug"></div>
<canvas id="cav" width="500" height="400" style="background-color: #000000 ;">你的浏览器不支持HTML5。</canvas>
</body>
</html>